package com.biancheng.biancheng.biancheng2;

import java.util.Scanner;

public class 汉诺塔 {

    private static void hannuot(Integer n,String a,String b,String c){
        if(n==1){
            System.out.println(a+"->"+c);
        }else {
            hannuot(n-1,a,c,b);
            System.out.println(a+"->"+c);
            hannuot(n-1,b,a,c);
        }
    }
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        hannuot(n,"a","b","c");
    }
}
